package com.sls.web.manager.recharge.service.impl;

import java.util.List;
import org.springframework.stereotype.Service;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.sls.core.common.CommonUtil;
import com.sls.core.socket.Head;
import com.sls.core.socket.SocketDTO;
import com.sls.web.manager.common.Constants;
import com.sls.web.manager.pojo.UserInfoVO;
import com.sls.web.manager.recharge.service.FaceValueService;
import com.sls.web.manager.socket.SuperService;

@Service("faceValueService")
public class FaceValueServiceImpl extends SuperService implements
		FaceValueService {


	@Override
	public List<Integer> queryFaceValueList(UserInfoVO userinfo) {
		Gson gson = CommonUtil.gson();
		Head head = new Head();
		head.setServiceCode(Constants.QUERY_FACE_VALUE_LIST);
		head.setIp(userinfo.getCurrentIp());
		head.setUserId(userinfo.getUserId());
		SocketDTO dto = super.send(head);
		List<Integer> saList = gson.fromJson(dto.getBody(),
				new TypeToken<List<Integer>>() {
				}.getType());
		return saList;
	}
}
